import request from '@/utils/request'

export function xhrAccountList(params = {
  limit: 20,
  page: 1
}) {
  return request({
    url: '/user/admin/list',
    method: 'get',
    params
  })
}

export function xhrCheckFaceCheckInfo(params) {
  return request({
    url: '/check/face/check/info',
    method: 'get',
    params
  })
}

export function xhrAbTests(params = {}) {
  return request({
    url: '/analysis/getAbTests',
    method: 'get',
    params
  })
}

export function xhrGetAddress(params) {
  return request({
    url: '/analysis/ipAddress',
    method: 'get',
    params
  })
}

export function xhrChannelList(params = {
  limit: 100,
  page: 1
}) {
  return request({
    url: '/user/channel',
    method: 'get',
    params
  })
}

export function xhrAccountDetail(params) {
  return request({
    url: '/user/detail',
    method: 'get',
    params
  })
}

export function xhrForbidAccount(data) {
  return request({
    url: '/user/banned',
    method: 'post',
    data
  })
}

export function xhrForbidRecordList(params) {
  return request({
    url: '/user/banned/list',
    method: 'get',
    params
  })
}

export function xhrPropChangeList(params) {
  return request({
    url: '/user/prop/list',
    method: 'get',
    params
  })
}

export function xhrPropChangeValue(data) {
  return request({
    url: '/user/prop/change/value',
    method: 'post',
    data
  })
}

export function xhrPropChangeCount(params) {
  return request({
    url: '/user/prop/change',
    method: 'get',
    params
  })
}

export function xhrPropChangeOptions(params) {
  return request({
    url: '/user/prop/options',
    method: 'get',
    params
  })
}

export function xhrAnchorList(params = {
  pageSize: 20,
  pageNum: 1
}) {
  return request({
    url: '/user/statistical/anchorList',
    method: 'get',
    params
  })
}

export function xhrAnchorStatistic(params = {
  pageSize: 20,
  pageNum: 1
}) {
  return request({
    url: '/anchor/statistic',
    method: 'get',
    params
  })
}

export function xhrAnchorLiftingRecord(params = {
  limit: 20,
  page: 1
}) {
  return request({
    url: '/analysis/lifting/record',
    method: 'get',
    params
  })
}

export function xhrAnchorDetail(params) {
  return request({
    url: '/user/anchor/detail',
    method: 'get',
    params
  })
}

export function xhrAnalysisDeleteUserClass(data) {
  return request({
    url: '/analysis/delete/user/class',
    method: 'post',
    data
  })
}

export function xhrAnalysisUserClassList(data) {
  return request({
    url: '/analysis/user/class/list',
    method: 'post',
    data
  })
}

export function xhrAnalysisLiveChat(params) {
  return request({
    url: '/analysis/liveChat',
    method: 'get',
    params
  })
}

export function xhrQueryFamilyRecord(params) {
  return request({
    url: '/check/query_family_record',
    method: 'get',
    params
  })
}

export function xhrCheckFamilyRecord(data) {
  return request({
    url: '/check/check_family_record',
    method: 'post',
    data
  })
}

export function xhrQueryFamilyInfo(params) {
  return request({
    url: '/family/query_family_info',
    method: 'get',
    params
  })
}

export function xhrQueryCheckApply(params) {
  return request({
    url: '/anchor/checkFamily/list',
    method: 'get',
    params
  })
}

export function xhrAnchorCheckFamily(data) {
  return request({
    url: '/anchor/checkFamily',
    method: 'post',
    data
  })
}

export function xhrFamilyClose(params) {
  return request({
    url: '/family/close',
    method: 'get',
    params
  })
}

export function xhrQueryFamilyMember(params) {
  const { familyId } = params
  return request({
    url: `/family/get_family_member/${familyId}`,
    method: 'get',
    params
  })
}

export function xhrUpdateFamilyInfo(data) {
  return request({
    url: '/family/update_family_info',
    method: 'post',
    data
  })
}

export function xhrAnalysisLiveChatDetail(params) {
  return request({
    url: '/analysis/liveChat/detail',
    method: 'get',
    params
  })
}

export function xhrReportList(params = {
  limit: 20,
  page: 1
}) {
  return request({
    url: '/user/accuse/list',
    method: 'get',
    params
  })
}

export function xhrFeedbackRecord(params = {
  limit: 20,
  page: 1
}) {
  return request({
    url: '/check/user/feedback/record',
    method: 'get',
    params
  })
}

export function xhrHandleReport(data) {
  return request({
    url: '/user/accuse/dispose',
    method: 'post',
    data
  })
}

export function xhrFeedbackDeal(data) {
  return request({
    url: '/check/user/feedback/deal',
    method: 'post',
    data
  })
}

export function xhrSupplementList(params) {
  return request({
    url: '/user/supplement',
    method: 'get',
    params
  })
}

export function xhrSupplementCreate(data) {
  return request({
    url: '/user/supplement/add',
    method: 'post',
    data
  })
}

export function xhrSupplementDelete(data) {
  return request({
    url: '/user/supplement/dispose',
    method: 'post',
    data
  })
}

export function xhrAnalysisOnlineHistory(params) {
  return request({
    url: '/analysis/online/History',
    method: 'get',
    params
  })
}

export function xhrAnalysisRealHistory(params) {
  return request({
    url: '/analysis/realTime/history',
    method: 'get',
    params
  })
}

export function xhrAnalysisRealTimeList(params) {
  return request({
    url: '/analysis/realTime/list',
    method: 'get',
    params
  })
}

export function xhrAnalysisInsertUserClass(data) {
  return request({
    url: '/analysis/insert/user/class',
    method: 'post',
    data
  })
}

export function xhrAnalysisOnlineUser(params) {
  return request({
    url: '/analysis/online/User',
    method: 'get',
    params
  })
}

// 充值订单
export function xhrPayOrderList(params) {
  return request({
    url: '/user/order/list',
    method: 'get',
    params
  })
}

// 计费点查询
export function xhrChargeUnitList() {
  return request({
    url: '/user/charge_unit/list',
    method: 'get'
  })
}

// 用户详情v2 补充字段
export function xhrGetCardTicket(params) {
  return request({
    url: '/user/get_card_ticket',
    method: 'get',
    params
  })
}
export function xhrGetDiamond(params) {
  return request({
    url: '/user/get_diamond',
    method: 'get',
    params
  })
}
export function xhrGetScore(params) {
  return request({
    url: '/user/get_score',
    method: 'get',
    params
  })
}
export function xhrListAction(params) {
  return request({
    url: '/user/action/list',
    method: 'get',
    params
  })
}
export function xhrGetGiftChat(params) {
  return request({
    url: '/user/get_chat_gift',
    method: 'get',
    params
  })
}
export function xhrListGiftChat(params) {
  return request({
    url: '/user/get_chat_gift/list',
    method: 'get',
    params
  })
}

export function xhrCancelLive(data) {
  return request({
    url: '/user/detail/cancelLive',
    method: 'post',
    data
  })
}

export function xhrCancelAnchor(data) {
  return request({
    url: '/user/cancelAnchor',
    method: 'post',
    data
  })
}

export function xhrConfirmAnchor(data) {
  return request({
    url: '/user/detail/confirmAnchor',
    method: 'post',
    data
  })
}

// 修改手机号
export function xhrEditPhone(data) {
  return request({
    url: '/user/update_phone',
    method: 'post',
    data
  })
}

// 修改分成
export function xhrUpdateShareRate(data) {
  return request({
    url: '/user/update_share_rate',
    method: 'post',
    data
  })
}

// 修改推荐权重
export function xhrChangeWeight(params) {
  return request({
    url: '/user/change_weight',
    method: 'get',
    params
  })
}

// 修改nickname
export function xhrEditNickname(data) {
  return request({
    url: '/user/update_nickName',
    method: 'post',
    data
  })
}

// 修改masterid
export function xhrEditMasterId(data) {
  return request({
    url: '/user/update_invite_user_id',
    method: 'post',
    data
  })
}

// 修改RandomMatchWeight
export function xhrUpdateRandomMatchWeightTwo(params) {
  const { userId, weight } = params
  return request({
    url: `/user/update_random_match_weight_two/${userId}/${weight}`,
    method: 'put',
    params
  })
}

export function xhrListSysMsg(params) {
  return request({
    url: '/message',
    method: 'get',
    params
  })
}
export function xhrCreateSysMsg(data) {
  return request({
    url: '/message',
    method: 'post',
    data
  })
}
export function xhrEditSysMsg(data) {
  return request({
    url: '/message',
    method: 'put',
    data
  })
}
export function xhrDelSysMsg(data) {
  return request({
    url: '/message',
    method: 'delete',
    data
  })
}
export function xhrPushSysMsg(data) {
  return request({
    url: '/message/push',
    method: 'post',
    data
  })
}
